<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
通过姓名查找: <input type="text" id="keyword"> &nbsp;&nbsp;<button onclick="search()">搜索!</button>
<table border="1">
    <thead>
        <th>Id</th>
        <th>Name</th>
        <th>Age</th>
        <th>操作</th>
    </thead>
    <tbody>
    <tr th:each="user: ${users}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.age}"></td>
    </tr>
    </tbody>
</table>
<script>
    function search() {
        var elem = document.getElementById("keyword");
        window.location.href = "/user?name=" + elem.value;
    }
</script>
</body>
</html>